<?php
$login = $_GET['login'];

include_once "ini.php";
dbconnect();

$json = array ();

$sql = "SELECT * FROM users WHERE nom_user='".$login."';";
$requete = mysql_query($sql);
if (!$requete)
{
    echo "SQL error : ", $sql;
    exit ;
}
else
{
    while ($tab = mysql_fetch_assoc($requete))
    {
        if ($tab['compte_active'] == 1)
        {

            $json = $tab;
            echo json_encode($json);
        }
        else
        {
            echo "{";
        	echo "error: 'error' \n";
			echo "}";
        }
    }

}


dbclose();
?>
